/**
*@author ken 
*@version 18/2/2012
//******************************************/

/** Control class*/
package board;

import player.*;

public class Move {
	
	private Board temBoard;
	
	/**
	// Accept an player array
	// Base on player gridX and gridY
	// update the board 2D array layout and cell array attribute*/
	public void updateBoard(Player[] pArr) {
		
		/** empty the board*/
		temBoard = new Board();
		
		for(int k=0; k<pArr.length; k++ ) {
			int posX = pArr[k].getGridX();
			int posY = pArr[k].getGridY();
			/** use playerID as a symbol on board*/
			temBoard.getGameBoard()[posY][posX] = "  " + pArr[k].getPlayerID() + " "; 
			/** add 1 player in that cell*/
			temBoard.getCellArr()[pArr[k].getCell()]++;
		}	
	}


	public Board getTemBoard() {
		return temBoard;
	}


	public void setTemBoard(Board temBoard) {
		this.temBoard = temBoard;
	}
}

